lat=localStorage.getItem('lat')
lng=localStorage.getItem('lng')
if(!lat||!lng){
  const geolocation = new qq.maps.Geolocation(
    "J2VBZ-JD6CR-GWSWW-W52NP-WHEG5-VIFK3",
    "waimai"
  );

  geolocation.getLocation(
      res => {
          console.log(res); // 纬度、经度、城市名等等等
          let {lat, lng,city} = res
          localStorage.setItem('lng',lng)
          localStorage.setItem('lat',lat)
          $.get('/api/area/find.jsp',{city_name:city},
          res=>{
              if(res.meta.state==200){
               localStorage.setItem('city_id',res.data.area_id)
               localStorage.setItem('city_name',res.data.area_name)
              }
             else{
                 console.log(res)
             }
          },
          'json'
          )
          // 根据city请求接口获取城市编号
      },
      err => {
         
      }
  );
}
city_name=localStorage.getItem('city_name')
city_id=localStorage.getItem('city_id')
$('.choose-city').text(city_name)
